import 'package:flutter/material.dart';
import 'package:geomancy/widgets/date_picker/date_picker_modal.dart';
import 'package:lunar/calendar/Lunar.dart';

class DatePickerUtil {
  ///打开弹窗
  static show(BuildContext context, {Widget? header, double? height, String? defaultValue, required Function(String value) getValue}) {
    showModalBottomSheet(
      context: context,
      builder: (BuildContext context) {
        return DatePickerModal(
          header: header,
          height: height,
          defaultValue: defaultValue,
          getValue: getValue,
        );
      },
    );
  }
  ///公立转化农历
  static String dateConversionLunar(DateTime date) {
    Lunar lunar = Lunar.fromDate(date);
    String lunarDay = lunar.getDayInChinese();
    return lunarDay;
  }
}